<template>
	<view class="device_data">
		<view v-if="type==0" class="main">
			<view class="dataItem">
				<text class="title">护套环流</text>
				<view class="value">A相电流(A):{{newData.aphaseValue+''||""}}</view>
				<view class="value">B相电流(A):{{newData.bphaseValue+''||""}}</view>
				<view class="value">C相电流(A):{{newData.cphaseValue+''||""}}</view>
			</view>
			<view class="dataItem">
				<text class="title">蓄电池电压(V):</text>
				<view class="value" style="display: inline-block;">{{newData.batteryVolt+''||""}}</view>
			</view>
			<view class="dataItem">
				<text class="title">信号强度:</text>
				<view class="value" style="display: inline-block;">{{newData.gprsSignalStrength+''||""}}</view>
			</view>
		</view>
		<view v-if="type==11" class="main">
			<view class="dataItem">
				<text class="title">报警信息</text>
				<view class="value">烟雾报警:{{newData.smogAlarm+''||"0"}}</view>
				<view class="value">光电报警:{{newData.peAlarm+''||"0"}}</view>
				<view class="value">位移信息:{{newData.displace+''||"0"}}</view>
				<view class="value">水位信息:{{newData.waterLevel+''||"0"}}</view>
			</view>
			<view class="dataItem">
				<text class="title">接头温度</text>
				<view class="value">A相接头温度(℃):{{newData.aphaseJointTemp+''||""}}</view>
				<view class="value">B相接头温度(℃):{{newData.bphaseJointTemp+''||""}}</view>
				<view class="value">C相接头温度(℃):{{newData.cphaseJointTemp+''||""}}</view>
			</view>
			<view class="dataItem">
				<text class="title">表皮温度</text>
				<view class="value">A相表皮温度(℃):{{newData.aphaseSkinTemp+''||""}}</view>
				<view class="value">B相表皮温度(℃):{{newData.bphaseSkinTemp+''||""}}</view>
				<view class="value">C相表皮温度(℃):{{newData.bphaseSkinTemp+''||""}}</view>
			</view>
		</view>
		<view v-if="type==8" class="main">
			<view class="dataItem">
				<text class="title">振动信息</text>
				<view class="value">X:{{newData.xdirectionStrength+''||""}}</view>
				<view class="value">Y:{{newData.ydirectionStrength+''||""}}</view>
				<view class="value">Z:{{newData.zdirectionStrength+''||""}}</view>
			</view>
			<view class="dataItem">
				<text class="title">信号强度:</text>
				<view class="value" style="display: inline-block;">{{newData.signalIntensity+''||""}}</view>
			</view>
			<view class="dataItem">
				<text class="title">电池电压:</text>
				<view class="value" style="display: inline-block;">{{newData.batteryVoltage+''||""}}</view>
			</view>
		</view>
		<view v-if="type==10" class="main">
			<view class="dataItem">
				<text class="title">温度</text>
				<view class="value">线缆温度:{{newData.cableTemp+''||""}}</view>
				<view class="value">环境温度:{{newData.environmentTemp+''||""}}</view>
			</view>
			<view class="dataItem">
				<text class="title">振动位移</text>
				<view class="value">X振动量:{{newData.xdirectionVibration+''||""}}</view>
				<view class="value">Y振动量:{{newData.ydirectionVibration+''||""}}</view>
				<view class="value">Z振动量:{{newData.zdirectionVibration+''||""}}</view>
			</view>
		</view>
		<view v-if="type==6" class="main">
			<view class="dataItem">
				<text class="title">最大放电量</text>
				<view class="value">A相最大放电量:{{newData.aphaseMaxElectric+''||""}}</view>
				<view class="value">B相最大放电量:{{newData.bphaseMaxElectric+''||""}}</view>
				<view class="value">C相最大放电量:{{newData.cphaseMaxElectric+''||""}}</view>
			</view>
			<view class="dataItem">
				<text class="title">最大放电频次</text>
				<view class="value">A相最大放电频次:{{newData.aphaseMaxFrequency+''||""}}</view>
				<view class="value">B相最大放电频次:{{newData.bphaseMaxFrequency+''||""}}</view>
				<view class="value">C相最大放电频次:{{newData.cphaseMaxFrequency+''||""}}</view>
			</view>
		</view>
		<view v-if="type==21" class="main"	>
			<view class="dataItem">
				<text class="title">电量</text>
				<view class="value">电量:{{newData.electricQuantity+''||""}}</view>
				<view class="value">连接状态:{{newData.linkState+''||""}}</view>
				<view class="value">运行状态:{{newData.runState+''||""}}</view>
			</view>
			<view class="dataItem">
				<text class="title">施工设备名称</text>
				<view class="value">{{newData.constructionDeviceName+''||""}}</view>
			</view>
		</view>
		<view v-else-if="type==1"></view>
	</view>
</template>

<script>
	export default {
		name: 'DataPage',
		props: {
			newData: {
				type: Object,
				default: () => {},
			},
			type:{
				type:Number/String,
				default:"0"
			}
		},
		data(){
			return {
				productType:[ //检测设备类型
					  {
					        value: '0',
					        label: '环流监测',
					    },
					    {
					        value: '6',
					        label: '外置局放',
					    },
					    {
					        value: '8',
					        label: '地钉',
					    },
					    {
					        value: '10',
					        label: '故障报警器',
					    },
					    {
					        value: '11',
					        label: '接头感应',
					    },
						{
						    value: '21',
						    label: '启停装置',
						},
				],
			}
		},
		watch: {
			newData(newVal, oldVal) {
				console.log('newVal:', newVal);
				console.log('oldVal:', oldVal);
				if (newVal && newVal.someProperty) {
					console.log(newVal.someProperty);
				} else {
					console.log('someData is not fully defined');
				}
			},
		},
		onShow() {
			
		},
		onLoad(option) {

		},
		methods: {
			
		}
	}
</script>

<style lang="scss" scoped>
	@import '@/assets/styles/global.scss';

	view {
		box-sizing: border-box;
	}

	.device_data {
		position: relative;
		// height: 100%;
		.main{
			display: flex;
			flex-wrap: wrap;
			justify-content:space-between;
			.dataItem {
				margin: 10rpx 0;
				.title {
					font-size: 36rpx;
			
				}
				.value {
					color: #666;
					padding: 10rpx 10rpx 0;
				}
			}
		}
		
	}

</style>